package xyz.yinpeng.demo.service;

import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
public class TestController {

    @RequestMapping("/provider/test")
    public Object test(@RequestBody ReqDTO req) {
        log.info("请求/provider/test接口，参数：{}", req);
        return new ResponseEntity<>("Hello " + req.getName(), HttpStatus.OK);
    }

    @Data
    static class ReqDTO {
        private String name;
    }

}
